home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presentation Library 1993 Spring / ARPL-Spring-93-Partner-Edition.iso / Applications / Word Processing / Aldus Personal Press 2.0 / PPPouch / AutoCreate / Newsletters / Classic Times / Classic Times
Encoding:
Text File  |  1992-05-29  |  18.3 KB  |  782 lines  |  [SGPA/SCPG]

  1.  
  2. on AutoCreate
  3. global TheCurrentDialog, theDialog
  4. global Page_One, Page_Two -- Current page style selections.
  5. global FolderBase, userOldMeasurements
  6.  
  7. set lockcursor to true
  8. set lockscreen to true
  9. set MouseCursor to busy
  10. put measurements into userOldMeasurements
  11. locatefonts
  12. put ":autocreate:newsletters:" into FolderBase
  13. open util script FolderBase&"_CTUtility"
  14. put 1 into Page_One
  15. put 1 into Page_Two
  16. put 501 into theCurrentDialog
  17. progressdialog open
  18.  
  19. repeat forever
  20.  
  21. do "put RunDialog" & TheCurrentDialog & "() into theResult"
  22.  
  23. switch
  24. case theResult = "Next" 
  25. put theCurrentDialog +1 into theCurrentDialog
  26. exit switch
  27. case theResult = "Prev" or theResult = "Previous"
  28. put theCurrentDialog -1 into theCurrentDialog
  29. exit switch
  30. case theResult = "Done"
  31. Exit repeat
  32. exit switch
  33. case theResult = "Cancel"
  34. get dialog(dispose, theDialog)
  35. exit AutoCreate
  36. exit switch
  37. end switch
  38.  
  39. end repeat
  40.  
  41.  
  42. -- Build the Pages
  43. Set mousecursor to busy
  44.  
  45. progressdialog show "Creating publication…"
  46. callscript "_CTsetpagesettings", "setpagesettings"
  47.  
  48. set currentpage to 1
  49.  
  50. -- Choose the Page Styles from the PICT ID's
  51. switch PAGE_ONE
  52. case 1011
  53. put 1 into PAGE_ONE
  54. exit switch
  55. case 1021
  56. put 2 into PAGE_ONE
  57. exit switch
  58. case 1031
  59. put 3 into PAGE_ONE
  60. exit switch
  61. case 1041
  62. put 4 into PAGE_ONE
  63. exit switch
  64. end switch
  65.  
  66. switch PAGE_TWO
  67. case 1012
  68. put 1 into PAGE_TWO
  69. exit switch
  70. case 1022
  71. put 2 into PAGE_TWO
  72. exit switch
  73. case 1032
  74. put 3 into PAGE_TWO
  75. exit switch
  76. case 1042
  77. put 4 into PAGE_TWO
  78. exit switch
  79. end switch
  80.  
  81.  
  82. progressdialog show "Creating page 1…"
  83. Switch Page_One
  84. case 1
  85. callscript "_Classic Times 2 col 1 art.pg 1", "build_page_1_pg_1" 
  86. exit switch
  87. case 2
  88. callscript "_Classic Times 2 col 2 art.pg 1", "build_page_2_pg_1"
  89. exit switch
  90. case 3
  91. callscript "_Classic Times 3 col 1 art.pg 1", "build_page_3_pg_1" 
  92. exit switch
  93. case 4
  94. callscript "_Classic Times 3 col 2 art.pg 1", "build_page_4_pg_1"
  95. exit switch
  96. end switch
  97.  
  98. set currentpage to 2
  99. progressdialog show "Creating page 2…"
  100. Switch Page_Two
  101. case 1
  102. callscript "_Classic Times 2 col 1 art.pg 2", "build_page_1_pg_2"
  103. exit switch
  104. case 2
  105. callscript "_Classic Times 2 col 2 art.pg 2", "build_page_2_pg_2"
  106. exit switch
  107. case 3
  108. callscript "_Classic Times 3 col 1 art.pg 2", "build_page_3_pg_2"
  109. exit switch
  110. case 4
  111. callscript "_Classic Times 3 col 2 art.pg 2", "build_page_4_pg_2"
  112. exit switch
  113. end switch
  114.  
  115. if theResult = "Done" then
  116. get dialog(dispose, theDialog)
  117. end if
  118. set mouseCursor to "arrow"
  119. progressdialog close
  120. set saveGlobals to True
  121.  
  122. end AutoCreate
  123.  
  124. on cleanup
  125. Global TheCurrentDialog, FolderBase, TheStories, TotalStories, userOldMeasurements
  126.  
  127. put 503 into TheCurrentDialog
  128. set ShuffleTextObjects to false
  129. put ":autocreate:newsletters:" into FolderBase
  130. open util script FolderBase&"_CTUtility"
  131. progressdialog open
  132. set lockscreen to true
  133. set lockcursor to true
  134. Set mousecursor to busy
  135. locatestories
  136.  
  137.  
  138. repeat forever
  139.  
  140. do "put RunDialog" & TheCurrentDialog & "() into theResult"
  141.  
  142. switch
  143. case theResult = "Next" 
  144. put theCurrentDialog +1 into theCurrentDialog
  145. exit switch
  146. case theResult = "Prev" or theResult = "Previous"
  147. put theCurrentDialog -1 into theCurrentDialog
  148. exit switch
  149. case theResult = "Done"
  150. Exit repeat
  151. exit switch
  152. case theResult = "Cancel"
  153. get dialog(dispose, theDialog)
  154. publicationsetup columns 1
  155. set view to sizetofit
  156. set measurements to userOldMeasurements
  157. exit Cleanup
  158. exit switch
  159. end switch
  160.  
  161. end repeat
  162.  
  163. callscript "_CTCopyFitEveryStory", "CopyFitEveryStory"
  164.  
  165. repeat with i = 1 to number of pages -- unlock all objects in doc so user has control
  166. set currentpage to i
  167. select all objects
  168. set locked to false
  169. end repeat
  170. set currentpage to 1
  171. select empty
  172.  
  173. set view to sizetofit
  174. set displayGuides to false
  175. set measurements to userOldMeasurements
  176. end cleanup
  177.  
  178.  
  179.  
  180. function RunDialog501
  181. -- Phase I, initial options.
  182. Global Page_One, Page_Two -- Scripted Pages to use.
  183. Global theDialog
  184.  
  185. put 2 into Num_Columns -- Number of columns
  186. put 1 into Num_Stories -- Number of stories
  187.  
  188. put dialog(preload, 501) into theDialog
  189.  
  190. -- Disable buttons
  191. SetDialogItem 4,"Disabled" -- Place Graphics
  192. SetDialogItem 3,"Disabled" -- Previous Button
  193. SetDialogItem 6,"Disabled" -- Place Text
  194.  
  195. -- Set default options
  196. SetDialogItem 7,"Set" -- "2 Columns"
  197. SetDialogItem 8,"Clear" -- "3 Columns"
  198.  
  199. SetDialogItem 10,"Set" -- "1 Story"
  200. SetDialogItem 11,"Clear" -- "2 Stories"
  201.  
  202. -- Define action procs
  203. SetDialogItem 9,  "Box" -- "Number of Columns Box"
  204. SetDialogItem 12,  "Box"  -- "Number of Stories Box"
  205. SetDialogItem 18,  "GrayBox" -- "Preview Box"
  206.  
  207.  
  208. put 1011 into PAGE_ONE
  209. put 1012 into PAGE_TWO
  210.  
  211.  
  212. repeat forever
  213.  
  214. SetDialogItem 19,"Enabled","Picture", PAGE_ONE
  215. SetDialogItem 20,"Enabled","Picture", PAGE_TWO
  216.  
  217. get dialog(display, theDialog)
  218.  
  219. Switch it
  220. -- Done Button.
  221. case 1 
  222. put "Done" into theResult
  223. exit repeat
  224. exit switch
  225.  
  226. -- Cancel button
  227. case 2
  228. put "Cancel" into theResult
  229. exit repeat
  230. exit switch
  231.  
  232. -- Help
  233. case 5
  234. helpdialog 501, "AutoCreate - Classic Newsletter Design Options"
  235. SetDialogItem 19,"Enabled","Picture", PAGE_ONE
  236. SetDialogItem 20,"Enabled","Picture", PAGE_TWO
  237. exit switch
  238.  
  239. -- 2 Columns
  240. case 7
  241. put 2 into Num_Columns
  242. if Num_Stories = 1 then
  243. put 1011 into PAGE_ONE
  244. put 1012 into PAGE_TWO
  245. else
  246. put 1021 into PAGE_ONE
  247. put 1022 into PAGE_TWO
  248. end if
  249.  
  250. exit switch
  251.  
  252. -- 3 Columns
  253. case 8
  254. put 3 into Num_Columns
  255. if Num_Stories = 1 then
  256. put 1031 into PAGE_One
  257. put 1032 into PAGE_TWO
  258. else
  259. put 1041 into PAGE_ONE
  260. put 1042 into PAGE_TWO
  261. end if
  262. exit switch
  263.  
  264. -- 1 Story
  265. case 10
  266. put 1 into Num_Stories
  267.  
  268. if Num_Columns = 2 then
  269. put 1011 into PAGE_ONE
  270. put 1012 into PAGE_TWO
  271. else
  272. put 1031 into PAGE_ONE
  273. put 1032 into PAGE_TWO
  274. end if
  275. exit switch
  276.  
  277. -- 2 Stories
  278. case 11
  279. put 2 into Num_Stories
  280. if Num_Columns = 2 then
  281. put 1021 into PAGE_ONE
  282. put 1022 into PAGE_TWO
  283. else
  284. put 1041 into PAGE_ONE
  285. put 1042 into PAGE_TWO
  286. end if
  287. exit switch
  288.  
  289. end switch
  290.  
  291. end repeat
  292.  
  293. return theResult
  294. end RunDialog501
  295.  
  296.  
  297.  
  298. function RunDialog503
  299. global TheStories, TotalStories, vTimes 
  300. -- Phase III, Page Options.
  301. set displayguides to false
  302.  
  303. put false into UpdateProxy
  304. put false into MakeJumpLines
  305. put false into IncludeTOC
  306. put "unknown" into TheResult
  307.  
  308. set currentPage to 1
  309.  
  310. progressdialog show "Preparing Options Dialog…"
  311. put dialog(preload, 503) into theDialog
  312. Set mousecursor to busy
  313.  
  314. SetDialogItem 12, "Box" -- Action proc for Folio Options
  315. SetDialogItem 17, "Box" --Action proc for Document Options
  316. SetDialogItem 20, "GrayBox" -- Action proc for Preview Box
  317.  
  318.  
  319. set currentpage to 1
  320.  
  321. --  -- Set status of Inlcude TOC button
  322. --  if TotalStories > 1 then
  323. --    put True into IncludeTOC
  324. --    SetDialogItem 7, "set", "enabled"
  325. --  else
  326. --    SetDialogItem 7, "clear", "disabled"
  327. --    put false into IncludeTOC
  328. --  end if
  329.  
  330. set visible of Object "TOC" to IncludeTOC
  331. set visible of object "TOC Line" to IncludeTOC
  332.  
  333.  
  334.  
  335. -- Set Volume name and date settings
  336. put date(Abbr) into THE_DATE -- Date = "Wed, Feb 5, 1992"
  337.  
  338. SetDialogItem 8, "Set","Contents", "Classic Times" -- Publication Name.
  339. SetDialogItem 4, "Contents", "Volume 1, Number 1" -- Volume.
  340. SetDialogItem 5, "Contents", THE_DATE -- Date.
  341.  
  342. -- Setup items on the page.
  343. put "Classic Times" into story "Publication Name"
  344. select all text  in story "Publication Name"
  345. set styleRecomposition to false
  346. set RulerJustification to Center
  347. Set TextSize to 50
  348. set textfont to vTimes
  349. set textface to plain
  350. set textface to bold
  351. set flexibleParaSpace to false
  352. Set flexibleLeading to false
  353. Set flexibleCharSize to true
  354. set styleRecomposition to true
  355. copyfit
  356. put "Classic Times" into OldPubTitle
  357.  
  358. put THE_DATE into story "Date"
  359. Select all text in Story "Date"
  360. set styleRecomposition  to false
  361. set RulerJustification to right
  362. Set TextSize to 14
  363. set textfont to vTimes
  364. put THE_DATE into OldDate
  365. set styleRecomposition  to true
  366.  
  367. put "Volume 1, Number 1" into story "Volume"
  368. Select all Text in story "Volume"
  369. set styleRecomposition  to false
  370. set TextSize to 14
  371. set textfont to vTimes
  372. put "Volume 1, number 1" into OldVolume
  373. set styleRecomposition  to true
  374.  
  375. put "On the Road Again" into Story "Issue Title"
  376. select all text in story "Issue Title"
  377. set styleRecomposition to false
  378. set RulerJustification to left
  379. set textsize to 36
  380. set textfont to vTimes
  381. set flexibleParaSpace to false
  382. Set flexibleLeading to false
  383. Set flexibleCharSize to true
  384. set styleRecomposition to true
  385. copyfit
  386. put "On the Road Again" into OldIssueTitle
  387.  
  388.  
  389. callscript "_CTSetStoryFonts", "SetStoryFonts"
  390.  
  391. select empty
  392. SetDialogItem 22,"Proxy" -- Update Proxy.
  393.  
  394. progressdialog hide
  395. repeat forever
  396. get dialog(display, theDialog)
  397.  
  398. switch it
  399.  
  400. case 1 -- Next Button
  401. put "Next" into theResult
  402. put true into UpdateProxy
  403. exit switch
  404. case 3 -- Help
  405. helpdialog 503, "AutoCreate - Other Newsletter Options"
  406. put true into UpdateProxy
  407. exit switch
  408. case 6
  409. put hilited(item6) into MakeJumpLines
  410. exit switch
  411.  
  412. case 7
  413. put hilited(item7) into IncludeTOC
  414. set visible of Object "TOC" to IncludeTOC
  415. set visible of object "TOC Line" to IncludeTOC
  416. put true into UpdateProxy
  417. exit switch
  418.  
  419. case 2 -- Update
  420. case 21
  421. case 20
  422. case 19 --User Force Update Preview Proxy
  423. put true into UpdateProxy
  424. exit switch
  425.  
  426. end switch 
  427.  
  428. if UpdateProxy then
  429. -- Check if Publication Title has been modified
  430.  
  431. if OldPubTitle ≠ ContentsOf(item8) then 
  432. put ContentsOf(item8) into OldPubTitle
  433. select all text  in story "Publication Name"
  434. set styleRecomposition to false
  435. put ContentsOf(item8) into story "Publication Name"
  436. set textfont to vTimes
  437. Set TextSize to 79
  438. set textface to plain
  439. set textface to bold
  440. set flexibleParaSpace to false
  441. Set flexibleLeading to false
  442. Set flexibleCharSize to true
  443. set styleRecomposition to true
  444. copyfit
  445. end if
  446.  
  447. -- Check if Date has been modified
  448. if OldDate ≠ ContentsOf(item5) then 
  449. put ContentsOf(item5) into OldDate
  450. select all text in story "Date"
  451. set styleRecomposition to false
  452. put ContentsOf(item5) into story "Date"
  453. Set TextSize to 14
  454. set textfont to vTimes
  455. set flexibleParaSpace to false
  456. Set flexibleLeading to false
  457. Set flexibleCharSize to true
  458. set styleRecomposition to true
  459. copyfit
  460. end if
  461.  
  462. -- Check if Volume has been modified
  463. if OldVolume ≠ ContentsOf(item4) then 
  464. put ContentsOf(item4) into OldVolume
  465. select all text in story "Volume"
  466. set styleRecomposition to false
  467. put ContentsOf(item4) into story "Volume"
  468. Set TextSize to 14
  469. set textfont to vTimes
  470. set flexibleParaSpace to false
  471. Set flexibleLeading to false
  472. Set flexibleCharSize to true
  473. set styleRecomposition to true
  474. copyfit
  475. end if
  476.  
  477. -- Check if Issue Title has been modified
  478. if OldIssueTitle ≠ ContentsOf(item9) then 
  479. put ContentsOf(item9) into OldIssueTitle
  480. select all text in story "Issue Title"
  481. set styleRecomposition to false
  482. put ContentsOf(item9) into story "Issue Title"
  483. Set TextSize to 36
  484. set textfont to vTimes
  485. set flexibleParaSpace to false
  486. Set flexibleLeading to false
  487. Set flexibleCharSize to true
  488. set styleRecomposition to true
  489. copyfit
  490. end if
  491.  
  492. select empty
  493. SetDialogItem 22,"Proxy" -- Update Proxy.
  494. put false into UpdateProxy
  495. end if
  496.  
  497. if TheResult = "Next" then 
  498. If IncludeTOC then 
  499. progressdialog show "Creating table of contents…"
  500. callscript "_CTCreateTOC", "CreateTOC"
  501. end if
  502. if MakeJumpLines then 
  503. progressdialog show "Creating " & quote & "Continued from" & quote & " lines…"
  504. callscript "_CTCreateJumpLines", "CreateJumpLines"
  505. end if
  506. exit repeat
  507. end if
  508. end repeat
  509.  
  510. get dialog(dispose, theDialog)
  511.  
  512. return theResult
  513.  
  514. End RunDialog503
  515.  
  516.  
  517.  
  518. function RunDialog504
  519. global TheStories, TotalStories
  520. -- Headline Editor.
  521. set displayguides to false
  522. set shuffleTextObjects to false
  523.  
  524. progressdialog show "Scanning for headlines…"
  525. put dialog(preload, 504) into theDialog
  526.  
  527. -- Action proc for Headline Entry Box
  528. SetDialogItem 11,   "Box"
  529.  
  530. -- Action proc for Divider line.
  531. SetDialogItem 14,  "Box"
  532. SetDialogItem 6,  "Box"
  533.  
  534. put "Unknown" into TheResult -- PPTalk can't evaluate uninitialized vars.
  535.  
  536.  
  537. -- Preset the Headlines
  538. repeat with x = 1 to TotalStories
  539. put item x of TheStories into TheTempStory
  540. set itemdel to "\"
  541. put item 3 of TheTempStory into ThePage -- Get Page.
  542. set itemdel to ","
  543. set currentpage to ThePage -- Go to that page.
  544. put empty into TempHold
  545. do "put paragraph 1 of story " & item 1 of storyloc of object (item x of TheStories)¬
  546. & " after TempHold"
  547. set the itemdel to numtochar(1)
  548. put tempHold into item x of TheCurrentTitles
  549. set itemdel to ","
  550. end repeat
  551.  
  552. progressdialog hide
  553. if TotalStories = 0 then exit RunDialog504
  554. -- If only one story, then grey the next and prev buttons
  555. if TotalStories = 1 then
  556. SetDialogItem 4,"Disabled" -- Prev Headline.
  557. SetDialogItem 3,"Disabled" -- Next Headline.
  558. end if
  559.  
  560. -- Tell user # of stories
  561. put "This publication has x headline(s). Personal Press has selected the" && ¬
  562. "first paragraph of the story for the headline. Make sure each headline is" &&¬
  563. "correct or type a new headline. " into TheInstructions
  564. put TotalStories into word 4 of TheInstructions
  565. SetDialogItem 9, "Text", TheInstructions
  566.  
  567. put 1 into CurrentStoryNum -- Holds the current story number.
  568.  
  569. -- Do every story in the pub.
  570. repeat forever
  571. put item CurrentStoryNum of TheStories into CurrentStoryName
  572.  
  573. set itemdel to "\"
  574. set currentpage to item 3 of CurrentStoryName
  575. set itemdel to ","
  576.  
  577. --Story preview box, Get the 1st 240 chars of the story.
  578. put empty into TheStory
  579. do "put trunctext(story "& ¬
  580. item 1 of storyloc of object CurrentStoryName & ¬
  581. ", 245)  after TheStory"
  582. SetDialogItem 15, "Enabled","Text", TheStory
  583.  
  584. -- Set name of story in the Headlines dialog box.
  585. SetDialogItem 16,"Contents", quote & ¬
  586. username of story (item 1 of storyloc of object CurrentStoryName) & quote
  587.  
  588. -- Set the current headline.
  589. set itemdel to numtochar(1)
  590. put item CurrentStoryNum of TheCurrentTitles into TheHeadline
  591. set itemdel to ","
  592. SetDialogItem 10,"Set","Contents",TheHeadline
  593.  
  594.  
  595. -- Set Headline Preview Proxy
  596. select empty
  597. set the itemdel to "\"
  598. select objects where word 2 of item 2 of name of this object = "Title" and¬
  599. (word 2 of name of object CurrentStoryName = word 2 of name of this object)
  600. set the itemdel to ","
  601. put selectedobjects() into objs
  602. repeat with q = 1 to number(items in objs)
  603. put item q of objs into y
  604. -- Put the name of this object into the Title object.
  605. put TheHeadline into story item 1 of storyloc of object y
  606. select all text in story item 1 of storyloc of object y
  607. set styleRecomposition to false
  608. set textsize to 20
  609. set flexibleParaSpace to false
  610. Set flexibleLeading to false
  611. Set flexibleCharSize to true
  612. set styleRecomposition to true
  613. copyfit
  614. put empty into isTitle
  615. end repeat -- Objects
  616.  
  617.  
  618. if (CurrentStoryNum = TotalStories) and (TotalStories > 1) then
  619. SetDialogItem 3,"Disabled" -- Next Headline.
  620. SetDialogItem 4,"Enabled" -- Prev Headline.
  621. else if (CurrentStoryNum = 1) and (TotalStories > 1) then
  622. SetDialogItem 3,"Enabled" -- Next Headline.
  623. SetDialogItem 4,"Disabled" -- Prev Headline.
  624. else if (CurrentStoryNum ≠ 1) and (TotalStories > 1) ¬
  625. and (CurrentStoryNum ≠ TotalStories) then
  626. SetDialogItem 3,"Enabled" -- Next Headline.
  627. SetDialogItem 4,"Enabled" -- Prev Headline.
  628. end if
  629.  
  630. -- Handle the dialog.
  631. repeat forever
  632. get dialog(display, theDialog)
  633.  
  634. switch it
  635. case 5 -- Help
  636. helpdialog 504, "AutoCreate - Headline Editor"
  637. SetDialogItem 9, "Text", TheInstructions
  638. SetDialogItem 15,"Text", TheStory
  639. exit switch
  640. case 19 -- Next Button
  641. put "Next" into theResult
  642. put ContentsOf(item10) into TheHeadline
  643. set itemdel to numtochar(1)
  644. put TheHeadline into item CurrentStoryNum of TheCurrentTitles
  645. set itemdel to ","
  646. exit repeat
  647. exit switch
  648.  
  649. case 3 -- "Next Headline"
  650. put ContentsOf(item10) into TempHold
  651. set itemdel to numtochar(1)
  652. put TempHold into item CurrentStoryNum of TheCurrentTitles
  653. set itemdel to ","
  654. put 1+CurrentStoryNum into CurrentStoryNum
  655. if CurrentStoryNum > TotalStories then
  656. put TotalStories into CurrentStoryNum
  657. end if
  658. exit repeat
  659. exit switch
  660.  
  661. case 4 -- "Prev Headline"
  662. put ContentsOf(item10) into tempHold
  663. set itemdel to numtochar(1)
  664. put TempHold into item CurrentStoryNum of TheCurrentTitles
  665. set itemdel to ","
  666. put CurrentStoryNum - 1 into CurrentStoryNum
  667. if CurrentStoryNum < 1 then put 1 into CurrentStoryNum 
  668. exit repeat
  669. exit switch
  670.  
  671.  
  672. end switch 
  673. end repeat -- Dialog Handler.
  674.  
  675.  
  676. if (TheResult = "Next") then 
  677. -- Assign the titles.
  678. put CurrentPage into OldPage
  679. progressdialog show "Installing headlines…"
  680. repeat with x = 1 to TotalStories
  681. put item x of TheStories into TempStory -- Get the story.
  682. set itemdel to "\"
  683. put item 3 of TempStory into StoryCurrentPage  -- Set the stories' page.
  684. set itemdel to ","
  685. put word 2 of item x of TheStories into TheStoryObject
  686.  
  687. -- Look for title objects.
  688. repeat with p = 1 to number of pages -- go thru all pages.
  689. set currentpage to p
  690. select empty
  691. put word 2 of item x of TheStories into stynum
  692. set the itemdel to "\"
  693. select objects where word 2 of item 2 of name of this object = "Title" and¬
  694. stynum = word 2 of name of this object
  695. set the itemdel to ","
  696. put selectedobjects() into objs
  697. repeat with q = 1 to number(items in objs)
  698. put item q of objs into y
  699. put word 2 of name of object y into TheSearchObject
  700.  
  701. set itemdel to numtochar(1)
  702. put item x of theCurrentTitles into TheChangedHeadLine
  703. set itemdel to ","
  704.  
  705. put TheChangedHeadline into story item 1 of storyloc of object y
  706. select all text in story item 1 of storyloc of object y
  707. set styleRecomposition to false
  708. set textsize to 20
  709. set flexibleParaSpace to false
  710. Set flexibleLeading to false
  711. Set flexibleCharSize to true
  712. set styleRecomposition to true
  713. copyfit
  714.  
  715. --Check the 1st ¶ to see if same as headline -- if Yes, Delete it.
  716. set currentpage to StoryCurrentPage
  717. do "put paragraph 1 of story " & ¬
  718. item 1 of storyloc of object (item x of TheStories)¬
  719. & " into TheCurrentHeadline"
  720. if TheCurrentHeadline = TheChangedHeadline then
  721. do "select text paragraph 1 of story " & ¬
  722. item 1 of storyloc of object (item x of TheStories)
  723. clear
  724. end if
  725. set currentpage to p
  726.  
  727.  
  728. end repeat -- Objects
  729. end repeat -- pages.
  730.  
  731. end repeat -- Stories.
  732. set currentpage to OldPage
  733.  
  734. if theResult = "Next" then exit repeat -- We're Done!
  735. end if
  736.  
  737. end repeat -- Story Count.
  738.  
  739. get dialog(dispose, theDialog)
  740.  
  741. return theResult
  742.  
  743. End RunDialog504
  744.  
  745. function RunDialog505
  746. callscript "_CTMakePullQuotes", "MakePullQuotes"
  747. return "next"
  748. end RunDialog505
  749.  
  750. function RunDialog506
  751. callscript "_CTMakeCaptions", "MakeCaptions"
  752. return "Done"
  753. end RunDialog506
  754.  
  755. on callscript file, message
  756. global FolderBase
  757. open script FolderBase&file
  758. do message
  759. close script FolderBase&file
  760. end callscript
  761.  
  762. on locatefonts
  763. global vHelvetica, vPalatino, vTimes, vNewYork, systemfonts
  764. put fontfamilies into systemfonts
  765. if systemfonts contains "New York" then put "New York"  into vNewYork
  766. else put "Geneva" into vNewYork
  767. if systemfonts contains "helvetica" then put "helvetica"  into vHelvetica
  768. else put "Geneva" into vHelvetica
  769. if systemfonts contains "Times" then put "Times" into vTimes
  770. else put vNewYork into vTimes
  771. if systemfonts contains "Palatino" then put "Palatino" into vPalatino
  772. else put vTimes into vPalatino
  773.  
  774. end locatefonts
  775.  
  776.  
  777. on autoCreateHelp
  778. helpdialog 500, "Autocreate - Place text and graphics"
  779. set saveglobals to true
  780. end autoCreateHelp
  781.  
  782.      Ù<BÏ